
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author XuanHung
 */
@SuppressWarnings("unused")
public class clsHocSinh {
    private String m_strHoTen = new String();
    private float m_fToan;
    private float m_fVan;
    private float m_fTrungBinh;
    
    
    public void setHoTen(String _strTen){
        m_strHoTen = _strTen;
    }
    public String getHoTen(){
        return m_strHoTen;
    }
    
    public void setToan(float _fToan){
        m_fToan = _fToan;
    }
    
    public float getToan(){
        return m_fToan;
    }
    
    public void setVan(float _fVan){
        m_fVan = _fVan;
    }
    public float getVan(){
        return m_fVan;
    }
    
    public void setDTB(float _fDTB){
        m_fTrungBinh = _fDTB;
    }
    
    public float getDTB(){
        return m_fTrungBinh;
    }
    
    public clsHocSinh(){
        m_fToan =  0;
        m_fVan = 0;
        m_fTrungBinh = 0;
    }
    public clsHocSinh (float _fToan, float _fVan){
        m_fToan = _fToan;
        m_fVan = _fVan;
        m_fTrungBinh = TrungBinh(_fToan,  _fVan);
    }
    static private float TrungBinh(float _fToan, float _fVan){
        return (_fToan + _fVan)/2;
    }
    
    
    static private void NhapHocSinh(clsHocSinh hs){
        hs = new clsHocSinh();
        Scanner sn = new Scanner(System.in);
        System.out.println("Nhap Ten:");
        hs.m_strHoTen = sn.nextLine();
        System.out.println("Nhap Diem Toan");
        hs.m_fToan = Float.parseFloat(sn.nextLine());
        System.out.println("Nhap Diem Van");
        hs.m_fVan = Float.parseFloat(sn.nextLine());
        hs.m_fTrungBinh = TrungBinh(hs.m_fToan, hs.m_fVan);
    }
    public static void NhapHocSinh(int n){
        clsHocSinh [] hs = new clsHocSinh[n];
        for(int t = 0; t < n; t++){
            NhapHocSinh(hs[t]);
        }
    }
}
